﻿CREATE PROCEDURE [ServiceEngine].[ListPoliciesBySubject]
	@EntityTypeID smallint
AS
BEGIN
	SET NOCOUNT ON;

	SELECT	N.[EntityID] as PolicyID, N.[EntityName] as [Name], N.EntityDescription as Description
	FROM	[ServiceEngine].Names N	
	JOIN	[ServiceEngine].Policies P on P.PolicyID = N.[EntityID] and N.[EntityTypeID] = 8
	WHERE	P.EntityTypeID = @EntityTypeID
	Order by N.[EntityName]
END
